extension MyDoubleExtension on double {
  String toFileSize({int fractionDigits = 0}) {
    if (this >= 1000000000000) {
      return "${(this / 1000000000000).toStringAsFixed(fractionDigits)}TB";
    } else if (this >= 1000000000) {
      return "${(this / 1000000000).toStringAsFixed(fractionDigits)}GB";
    } else if (this >= 1000000) {
      return "${(this / 1000000).toStringAsFixed(fractionDigits)}MB";
    } else if (this >= 1000) {
      return "${(this / 1000).toStringAsFixed(fractionDigits)}KB";
    }
    return "${this}B";
  }
}
